home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / tess / tess-1.0 / p4.m < prev    next >
Encoding:
Text File  |  1992-06-30  |  831 b   |  45 lines

  1. #import "aGroup-inter.h"
  2. #import "aGroup.h"
  3. #import "p4.h"
  4.  
  5. @implementation p4
  6. - defaultConfig
  7. {
  8.   [self noAngleSetup];
  9. }
  10. - clip: (float) x : (float) y
  11. {
  12.   PSmoveto(x,y);
  13.   PSrectclip(0,0,bounds.size.height,bounds.size.width);
  14.   return self;
  15. }
  16. - resizeGenerator
  17. {
  18.   latticesize.height = 2.0 * bounds.size.height;
  19.   latticesize.width = 2.0 * bounds.size.width;
  20.   overx = latticesize.width;
  21.   gravy = upy/2;
  22.   gravx = (upx+overx)/2;
  23.   return self;
  24. }
  25. - makeLatticeUnitAt: (NXPoint *) point fromImage: srcimg 
  26. {
  27.   id imgrep;
  28.   NXPoint pt;
  29.   int i;
  30.   
  31.   pt.x = - point->x ;
  32.   pt.y = - point->y ;
  33.  
  34.   imgrep = [srcimg bestRepresentation];
  35.   for(i=0;i<4;i++){
  36.     PSgsave(); // lower left
  37.     PSrotate(90*i);
  38.     [self clip:0.0:0.0];[imgrep drawAt: &pt];
  39.     PSgrestore();
  40.   }
  41.   return self;
  42. }
  43. - (BOOL) isRigidLattice { return YES; }
  44. @end
  45.